$(document).ready(function(e) {
    $(".dir_date").find("li:first").click(function(){
		var date = $(this).attr("name");
		$(".sure").attr("name",date)
		$(".delete").fadeIn("fast");
		$(".makesure span").html(date);
	});
	$(".dir_date li")
	.mouseover(function(){
		$(this).css("background", "#FFF");
	})
	.mouseout(function(){
		$(this).css("background", "#9CF");
	});
});
$(document).ready(function(e) {
    $(".wait").click(function(){
		$(".delete").fadeOut("fast");
	});
    $(".sure").click(function(){
		var date = $(this).attr("name");
		$.ajax({
			type:"GET",
			url:"delImgByDate",
			data:"date=" + date,
			beforeSend: function(){},
			success: function(data){
				if(data != 0){
					alert("ok");
					$.ajax({
						type:"POST",
						url:"filemanage",
						dataType:"html",
						beforeSend: function(){},
						success: function(data){
							$(".content").html(data);
							check();
						}
					});
				}
				else
					alert("error");
			}
		});		
		$(".delete").fadeOut("fast");
	});
});

function check(){
	var height =  $(window).height();
	if(height >= (160+$(".content").height())){
		$(".foot").addClass("foot_bg");
	}
	else{
		$(".foot").removeClass("foot_bg");
	}
}